

package com.maoshi.shop.distribution.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maoshi.shop.bean.model.OrderItem;
import com.maoshi.shop.distribution.comment.model.DistributionProdBind;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 分销商品绑定表
 *
 * @author xwc
 * @date 2019-04-22 10:01:44
 */
public interface DistributionProdBindMapper extends BaseMapper<DistributionProdBind> {
    Long getDistributionUserIdByUserIdAndProdId(@Param("userId") String userId, @Param("prodId") Long prodId,@Param("state") Integer state);

    void updateStateByUserIdByUserIdAndProdId(@Param("userId") String userId, @Param("prodId") Long prodId,@Param("state") Integer state);

    Long getNewDistributionUserIdByOrderItems(@Param("orderItems")List<OrderItem> orderItems);

    void updateBindTimeByUserIdAndProdId(@Param("userId") String useriId, @Param("prodId") Long prodId,@Param("distributionUserId") Long distributionUserId, @Param("bindTime") Date bindTime);

    void updateStateByDistributionUserId(@Param("distributionUserId") Long distributionUserId,@Param("state") Integer state);
}
